package org.mozhu.mboot.admin.system.resource.repository;

import org.mozhu.mboot.admin.system.resource.entity.Resource;
import org.mozhu.mboot.core.data.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 资源 - 数据访问层接口
 *
 * @author mozhu
 */
public interface ResourceRepository extends BaseRepository<Resource, Long> {

    @Query("from Resource where type = ?1 order by weight asc")
    List<Resource> getAllResources(String type);

    @Query("from Resource order by weight asc")
    List<Resource> getAllResources();

}
